﻿using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace OA.Mvc.Filters
{
	public class OAExceptionAttruibute:HandleErrorAttribute
	{
        // 异常信息队列
        public static Queue<Exception> Exceptions = new Queue<Exception>();
        public override void OnException(ExceptionContext filterContext)
        {
            //var logger = LogManager.GetLogger("logger");
            //logger.Error(filterContext.Exception.Message);

            Exceptions.Enqueue(filterContext.Exception);  // 入队
            filterContext.HttpContext.Response.Redirect("/error");


            base.OnException(filterContext);
        }
    }
}